package com.mes.inventory.domain;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.GenericGenerator;

import com.mes.basicdata.domain.Employee;
import com.mes.common.domain.BasicModel;

/**
 * <p>
 * WarebinManager
 * </p>
 * 
 */
@Entity()
//@org.hibernate.annotations.Entity(dynamicInsert=true,dynamicUpdate=true)
@Table(name = "I_WAREBINMANAGER")
//@BatchSize(size=10)
//@Lazy(value=true)
//@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class WarebinKeeper extends BasicModel {

	// Fields

	@Id
	@GenericGenerator(name = "uniqueId", strategy = "assigned")
	@Column(name = "UNIQUEID")
	private String uniqueId;
	
	@Override
	public String getUuid() {
		return uniqueId;
	}

	@Override
	public void setUuid(String uuid) {
		this.uniqueId = uuid;
	}
	
	public String getUniqueId() {
		return uniqueId;
	}

	public void setUniqueId(String uniqueId) {
		this.uniqueId = uniqueId;
	}

	/**
	 * ���Ӷ���ӳ��--invWarehouse
	 */
	@Column(name="WAREHOUSEID",length=50)
	protected String warehouseUid;
	
	//mant-to-one
	@ForeignKey(name="null")
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="WAREHOUSEID",insertable=false,updatable=false)
	protected Warehouse warehouse;
	
	/**
	 * ���Ӷ���ӳ��--InvWarebin
	 */
	@Column(name="BINID",length=50)
	protected String warebinUid;	
	
	//mant-to-one
	@ForeignKey(name="null")
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="BINID",insertable=false,updatable=false)
	protected Warebin warebin;
	
	/**
	 * ���Ӷ���ӳ��--Employee
	 */
	@Column(name="EMPLOYEEID",length=100)
	protected String employeeUid;
	
	//mant-to-one
	@ForeignKey(name="null")
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="EMPLOYEEID",insertable=false,updatable=false)
	protected Employee employee;
	
	//protected String duty;
	
	@Column(name="ISDEFAULT", precision=2,scale=0)
	protected Boolean isDefault;

	// Constructors

	/** default constructor */
	public WarebinKeeper() {
	}

	/**
	 * ��ȡ�ⷿ���
	 * @return
	 */
	public String getWarehouseUid() {
		return warehouseUid;
	}

	/**
	 * ���ÿⷿ���
	 * @param warehouseUid
	 */
	public void setWarehouseUid(String warehouseUid) {
		this.warehouseUid = warehouseUid;
	}

	/**
	 * ��ȡ�ⷿ����
	 * @return
	 */
	public Warehouse getWarehouse() {
		return warehouse;
	}

	/**
	 * ���ÿⷿ����
	 * @param warehouse
	 */
	public void setWarehouse(Warehouse warehouse) {
		this.warehouse = warehouse;
	}

	/**
	 * ��ȡ��λ���
	 * @return
	 */
	public String getWarebinUid() {
		return warebinUid;
	}

	/**
	 * ���ù�λ���
	 * @param warebinUid
	 */
	public void setWarebinUid(String warebinUid) {
		this.warebinUid = warebinUid;
	}

	/**
	 * ��ȡ��λ����
	 * @return
	 */
	public Warebin getWarebin() {
		return warebin;
	}

	/**
	 * ���ù�λ����
	 * @param warebin
	 */
	public void setWarebin(Warebin warebin) {
		this.warebin = warebin;
	}

	/**
	 * ��ȡ��Ա���
	 * @return
	 */
	public String getEmployeeUid() {
		return employeeUid;
	}

	/**
	 * ������Ա���
	 * @param employeeUid
	 */
	public void setEmployeeUid(String employeeUid) {
		this.employeeUid = employeeUid;
	}

	/**
	 * ��ȡ��Ա����
	 * @return
	 */
	public Employee getEmployee() {
		return employee;
	}

	/**
	 * ������Ա����
	 * @param employee
	 */
	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

//	/**
//	 * ��ȡְ��
//	 * @return
//	 
//	@XmlElement(nillable = false, minOccurs = "0")
//	public String getDuty() {
//		return duty;
//	}*/
//
//	/**
//	 * ����ְ��
//	 * @param duty
//	 */
//	public void setDuty(String duty) {
//		this.duty = duty;
//	}

	/**
	 * ��ȡĬ��״̬�����Ƿ�ΪĬ��Ա��
	 * @return
	 */
	public Boolean getIsDefault() {
		return isDefault;
	}

	/**
	 * ����Ĭ��״̬�����Ƿ�ΪĬ��Ա��
	 * @param isdefault
	 */
	public void setIsDefault(Boolean isDefault) {
		this.isDefault = isDefault;
	}

	
}